Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove whatwg-fetch #1134

Merged
merged 4 commits into from
Jan 6, 2017
Merged

Remove whatwg-fetch #1134

merged 4 commits into from
Jan 6, 2017

Conversation

calebmer
Copy link
Contributor

@calebmer calebmer commented Jan 5, 2017

As per an earlier discussion, this PR removes whatwg-fetch and replaces it with a runtime warning if a global fetch implementation was not found 👍

Looks like this one kills another 15% in file size taking us down to 21.7 kB gzipped.

  • Make sure all of the significant new logic is covered by tests
  • Make sure all tests and linter rules pass
  • Update CHANGELOG.md with your change

@@ -1,3 +1,5 @@
import './fetch';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be imported in the network interface only - that's the only part that depends on fetch.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The whatwg-fetch import was in both transport/networkInterface.js and transport/batchedNetworkInterface.js. Both of which are also imported into this file, so the same behavior would occur if we moved this to one or the other files.

With that in mind, would you still like it moved to the network interface, and if so which one? Or both?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, that's a good point. We don't have any facility for not loading part of the code.

Given that, can we print the warning only when createNetworkInterface is called?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, moved it.

@helfer
Copy link
Contributor

helfer commented Jan 6, 2017

@calebmer Looks great!! Can you create a PR on the docs to make sure we don't forget to tell people that they have to install a fetch implementation now?

@helfer helfer merged commit 99155f0 into zero-decimal-six Jan 6, 2017
@helfer helfer removed the in progress label Jan 6, 2017
@helfer helfer deleted the refactor/remove-whatwg-fetch branch January 6, 2017 15:50
@calebmer
Copy link
Contributor Author

calebmer commented Jan 6, 2017

@helfer 👍

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants